from wcferry import Wcf

# 初始化 WeChatFerry
wcf = Wcf()


def send_audio(wxid, audio_path):
    # 发送语音文件
    status = wcf.send_file(audio_path, wxid)
    if status == 0:
        print(f"成功发送语音消息给 {wxid}")
    else:
        print(f"发送语音消息失败，错误码：{status}")


# 示例：发送语音消息
audio_file_path = 'music001.mp3'  # 替换为您的语音文件路径
recipient_wxid = 'wxid_gwhmredzdf1w22'  # 替换为接收者的 wxid
send_audio(recipient_wxid, audio_file_path)
